package com.xja.book.service.impl;

import com.xja.book.entity.BookInfo;
import com.xja.book.mapper.BookInfoMapper;
import com.xja.book.service.BookInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("bookInfoService")
public class BookInfoAServiceImpl implements BookInfoService {

    @Autowired
    private BookInfoMapper bookInfoMapper;
    public List<BookInfo> findBookInfoAll() throws Exception {

        return bookInfoMapper.findAllBookInfo();
    }

    public void addBookInfo(BookInfo bookInfo) throws Exception {
        bookInfoMapper.insert(bookInfo);
    }
     public void deleteBookInfo(Integer bid) throws Exception {
        bookInfoMapper.deleteByPrimaryKey(bid);
    }

    public void updateBookInfo(BookInfo bookInfo) throws Exception {
        bookInfoMapper.updateByPrimaryKey(bookInfo);
    }


}
